package labelsystem.config;/**
 * @projectName careOlder
 * @Description TODO
 * @author MCG
 * @time 2023/3/30 21:11
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 *description: TODO
 *@author MCG
 *@date 2023/3/30 21:11
 *@Version 1.0
 */
@Configuration
@EnableSwagger2
public class swaggerConfig {
    @Bean
    public Docket productApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo()).groupName("MCGApi")
                .select().apis(RequestHandlerSelectors.basePackage("labelsystem.Controller"))
                .build();

    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder().title("肃为后台管理系统").description("后台管理系统API")
                .version("1.0").build();
    }
}
